//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {
        //1.BM5反转字符串
        public String solve (String str) {
            char[] charArray = str.toCharArray();
            char tmp = 0;
            int len = charArray.length;
            int left = 0;
            int right = len - 1;
            while (left < right) {
                tmp = charArray[left];
                charArray[left] = charArray[right];
                charArray[right] = tmp;
                left++;
                right--;
            }
            str = new String(charArray);
            return str;
        }
        //2.BM7盛水最多的容器
        public int maxArea (int[] height) {
            int len = height.length;
            int left = 0;
            int right = len - 1;
            int area = 0;
            int maxArea = 0;
            int h = 0;
            while (left < right) {
                if (height[left] <= height[right]) {
                    h = right - left;
                    area = height[left] * h;
                    maxArea = Math.max(area, maxArea);
                    left++;
                } else {
                    h = right - left;
                    area = height[right] * h;
                    maxArea = Math.max(area, maxArea);
                    right--;
                }
            }
            return maxArea;
        }
    }
}